package innerclass;

public class Parcel10 {
    public Destination destination(String dest,float price){
        return new Destination() {
            private  int cost;
            {
                cost=Math.round(price);
                if (cost>100)
                    System.out.println("over budget ");

            }
            @Override
            public String readLabel() {
                return label;
            }
            private String label=dest;
        };

    }

    public static void main(String[] args) {
        Parcel10 parcel10=new Parcel10();
        Destination destination=parcel10.destination("张淳柏",1000);
    }

}
